package models;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "t_ShipInfo")
public class ShipInfo_T_Entity implements Serializable{
    private static final long serialVersionUID = 1L;

    private int fdShipRowId;
    private String fdShipName;
    private String fdInitialShipName;
    private String fdShipOwner;
    private Integer fdTonnage;

    @Id
    @Column(name = "fd_ShipRowId", nullable = false)
    public int getFdShipRowId() {
        return fdShipRowId;
    }

    public void setFdShipRowId(int fdShipRowId) {
        this.fdShipRowId = fdShipRowId;
    }

    @Id
    @Column(name = "fd_ShipName", nullable = false, length = 255)
    public String getFdShipName() {
        return fdShipName;
    }

    public void setFdShipName(String fdShipName) {
        this.fdShipName = fdShipName;
    }

    @Id
    @Column(name = "fd_InitialShipName", nullable = true, length = 255)
    public String getFdInitialShipName() {
        return fdInitialShipName;
    }

    public void setFdInitialShipName(String fdInitialShipName) {
        this.fdInitialShipName = fdInitialShipName;
    }

    @Id
    @Column(name = "fd_ShipOwner", nullable = false, length = 50)
    public String getFdShipOwner() {
        return fdShipOwner;
    }

    public void setFdShipOwner(String fdShipOwner) {
        this.fdShipOwner = fdShipOwner;
    }

    @Id
    @Column(name = "fd_tonnage", nullable = true)
    public Integer getFdTonnage() {
        return fdTonnage;
    }

    public void setFdTonnage(Integer fdTonnage) {
        this.fdTonnage = fdTonnage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ShipInfo_T_Entity that = (ShipInfo_T_Entity) o;
        return fdShipRowId == that.fdShipRowId &&
                Objects.equals(fdShipName, that.fdShipName) &&
                Objects.equals(fdInitialShipName, that.fdInitialShipName) &&
                Objects.equals(fdShipOwner, that.fdShipOwner) &&
                Objects.equals(fdTonnage, that.fdTonnage);
    }

    @Override
    public int hashCode() {

        return Objects.hash(fdShipRowId, fdShipName, fdInitialShipName, fdShipOwner, fdTonnage);
    }
}
